package com.starblink.android.basic.btmnavanim;

import com.starblink.basic.util.log.YYLogUtils;

import java.util.ArrayList;

public class NavAnimSub implements NavSubject {

    //    private ArrayList<NavObserver> observers;
    private NavObserver observer = null;
    private String tag;
    private int dy;

    @Override
    public void registerObserver(NavObserver o) {
        this.observer = o;
    }

    @Override
    public void removeObserver(NavObserver o) {
        this.observer = null;
    }

    @Override
    public void notifyObservers() {
        observer.update(tag, dy);
    }

    public void navAnimChanged() {
        notifyObservers();
    }

    public void setNavAnimData(String tag, int dy) {
        this.tag = tag;
        this.dy = dy;
        navAnimChanged();
    }
}
